<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>Document</title>
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/metinfo.css" />
	<script type="text/javascript" src="__PUBLIC__/js/jquery-1.8.0.js"></script>
	<script type="text/javascript" src="__PUBLIC__/js/cookie.js"></script>
	<script type="text/javascript">
	$(function(){
		$('#module').on('change',function(){
			var value = parseInt($(this).val());
			var action = "getaction";
			var str = "方法";
			var id = "action";
			var txt = $('#module').find('option:selected').text().split('|');
			$('input[name=module]').val(txt[0]);
			getRs(action,value,str,id);
		});
		$('#action').on('change',function(){
			var value = $(this).find(':selected').text();
			var arr = value.split('|');
			//var 
		})
	})
	function getModule(value){
		var action = "getmodule";
		var value = value;
		var str = "模块";
		var id = "module";
		var txt = $('#name').find('option:selected').text().split('|');
		$('input[name=name]').val(txt[0]);
		getRs(action,value,str,id);
	}
	function getRs(action,value,str,id){
		var val = parseInt(value);
		if(val >= 0){
			$.post("{:U('User/ajax')}",{action:action,modpid:val},function(data){
				if(data.status == 1){
					var html = "<option value='-1'>---选择"+str+"---</option>";
					for(var i = 0; i < data.data.length; i++ ){
						html += "<option value='"+data.data[i].moduleid+"'>"+data.data[i].modname+"|"+data.data[i].moddesc.trim()+"</option>";
					}
					$('#'+id).empty();
					$('#'+id).append(html);
				}
			})
		}
	}
	</script>
</head>
<body>
	<div class="metinfotop">
	<div class="position">简体中文：内容管理 > <a href="">内容管理</a> > <a href=''>文章管理</a></div>
	<div class="return"><a href="">&lt;&lt;返回</a></div>
	</div>
	<div class="clear"></div>
	<form action="{:U('User/addnode')}" method="post">
		<table class='table' cellpadding="2" cellspacing="1" style="width:700px;">
			<tr>
				<td class="text">权限名称：</td>
				<!--td class="input">项目
					<select class="text" onchange="getModule(this.value)" id="name">
					<option value="-1">---选择项目---</option>
					<volist name="nodelist" id="vo">
					<option value="{$vo.moduleid}">{$vo.modname}|{$vo.moddesc}</option>
					</volist>
					</select>
					&nbsp;&nbsp;模块&nbsp;&nbsp;<select class="text" id="module"></select>&nbsp;&nbsp;操作&nbsp;&nbsp;<select class="text" id="action">	</select>
					<input type="hidden" name="name" value="" />
					<input type="hidden" name="module" value="" />
					<input type="hidden" name="action" value="" />
				</td-->
				<td class="input"><input type="text" class="text" name="name"/></td>
			</tr>
			<tr>
				<td class="text">权限描述：</td>
				<td class="input"><input type="text" class="text" name="title"/></td>
			</tr>
			<tr>
				<td class="text">权限备注：</td>
				<td class="input"><input type="text" class="text" name="remark"/></td>
			</tr>
			<tr>
				<td class="text">权限类型：</td>
				<td class="input">
					<input type="radio" name="level" value="1" checked/>项目
					<input type="radio" name="level" value="2" />模块
					<input type="radio" name="level" value="3" />操作
				</td>
			</tr>
			<tr>
				<td class="text">上级权限：</td>
				<td class="input">
					<select name="pid" id="select" class="select">
						    <volist name="tree" id="vo">
						    	<option value="{$vo.id}">{$vo.title}</option>
						        <volist name="vo['son']" id="sub">
						            <option value="{$sub.id}">&nbsp;&nbsp;&nbsp;&nbsp;├─{$sub.title}</option>
						            <volist name="sub['son']" id="subse">
						            	<option value="{$subse.id}">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;└──{$subse.title}</option>
						            </volist>
						        </volist>
						    </volist>
					</select>
				</td>
			</tr>
			<tr>
				<td class="text">排序：</td>
				<td class="input"><input type="text" class="text" name="sort" value="1"/></td>
			</tr>
			<tr>
				<td class="text">权限状态：</td>
				<td class="input"><input type="radio" class="radio" name="status" value="0"/>禁用&nbsp;&nbsp;<input type="radio" class="radio" checked="checked" name="status" value="1" />启用</td>
			</tr>
			<tr>
				<td colspan="2" align="center">
					<input type="reset" value="重置" class="submit" />
					<input type="submit" value="添加" class="submit" />
				</td>
			</tr>
		</table>
	</form>
</body>
</html>